<?php
declare (strict_types=1);

namespace app\api\controller;

use app\api\logic\IndexLogic;
use app\common\controller\ApiController;

class Index extends ApiController
{
    protected array $notNeedLogin = ['index', 'indexProjects', 'config'];

    public function index()
    {
        $result = IndexLogic::getIndexData();
        return $this->data($result);
    }

    public function indexProjects()
    {
        $params = $this->request->param();
        $result = IndexLogic::getProjects($params['type']);
        return $this->data($result);
    }

    public function config()
    {
        $result = IndexLogic::getConfigData();
        return $this->data($result);
    }

}
